package com.tionsy.springbootshiro.controller;

import com.tionsy.springbootshiro.common.model.Result;
import com.tionsy.springbootshiro.service.MenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@Api(value = "菜单接口", tags = {"菜单接口"})
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/all")
    @RequiresPermissions("menu:get")
    @ApiOperation(value = "获取所有菜单信息", produces = "application/json")
    public Result getAllMenus(){
        return Result.build().success("获取成功",menuService.getAllMenus());
    }
}

